package org.pushforward.iwillsurvive.data;

import java.sql.Timestamp;


/**
 * @author Sabre Runner
 *
 */
public class TypeValuePair
{
	public enum PairTypeEnum {INT, LONG, FLOAT, DOUBLE, STRING, TIMESTAMP, BOOLEAN};

	private PairTypeEnum type;
	private Object value;

	public TypeValuePair(PairTypeEnum type, Object value)
	{
		this.type = type;
		this.value = value;
	}

	public PairTypeEnum Type() { return type; }
	public Object Value() { return value; }
	public int IntValue()
	{
		Integer val = (Integer)value;
		return val.intValue();
	}
	public long LongValue()
	{
		Long val = (Long)value;
		return val.longValue();
	}
	public float FloatValue()
	{
		Float val = (Float)value;
		return val.floatValue(); 
	}
	public double DoubleValue()
	{
		Double val = (Double)value;
		return val.doubleValue(); 
	}
	public String StringValue()
	{
		String val = (String)value;
		return val.toString(); 
	}
	public Timestamp TimestampValue()
	{
		return (Timestamp)value;
	}
	public boolean BooleanValue()
	{
		Boolean val = (Boolean)value;
		return val.booleanValue(); 
	}
}

